]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Transition the ShellApp state when ready.
authorGiovanni Campagna <gcampagna@src.gnome.org>
Sun, 7 Nov 2010 19:51:25 +0000 (20:51 +0100)
committerOwen W. Taylor <otaylor@fishsoup.net>
Tue, 22 Mar 2011 02:42:25 +0000 (22:42 -0400)
shell_app_state_transition emits a signal, so invoke it only when
ready, or signal handlers will see an object which is in an invalid
state.

https://bugzilla.gnome.org/show_bug.cgi?id=632501

src/shell-app.c

index d3b00cff22dd1647d7e5cf9ef6cedec321443801..7dff44106249d85e096985107af7bb133d6330ba 100644 (file)
@@ -780,9 +780,6 @@ _shell_app_add_window (ShellApp        *app,
 
   g_object_freeze_notify (G_OBJECT (app));
 
-  if (app->state != SHELL_APP_STATE_STARTING)
-    shell_app_state_transition (app, SHELL_APP_STATE_RUNNING);
-
   if (!app->running_state)
       create_running_state (app);
 
@@ -795,6 +792,9 @@ _shell_app_add_window (ShellApp        *app,
   if (user_time > app->running_state->last_user_time)
     app->running_state->last_user_time = user_time;
 
+  if (app->state != SHELL_APP_STATE_STARTING)
+    shell_app_state_transition (app, SHELL_APP_STATE_RUNNING);
+
   g_object_thaw_notify (G_OBJECT (app));
 
   g_signal_emit (app, shell_app_signals[WINDOWS_CHANGED], 0);